package com.mcc.common.core.domain.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 * 用户对象 sys_user
 *
 * @author gxy
 */
@ApiModel("用户对象")
@Data
public class SysUser implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId
    @ApiModelProperty("用户ID")
    private Long userId;

    @ApiModelProperty("部门ID")
    private Long deptId;

    @ApiModelProperty("用户账号")
    private String userName;

    @ApiModelProperty("用户昵称")
    private String nickName;

    @ApiModelProperty("用户邮箱")
    private String email;

    @ApiModelProperty("手机号码")
    private String phonenumber;

    @ApiModelProperty("用户性别 0=男,1=女,2=未知")
    private String sex;

    @ApiModelProperty("用户头像")
    private String avatar;

    @ApiModelProperty("密码")
    private String password;

    @ApiModelProperty("帐号状态（0正常 1停用）")
    private String status;

    @ApiModelProperty("最后登录IP")
    private String loginIp;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty("最后登录时间")
    private Date loginDate;

    @ApiModelProperty("创建者")
    private String createBy;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty("创建时间")
    private Date createTime;

    @ApiModelProperty("更新者")
    private String updateBy;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty("更新时间")
    private Date updateTime;

    @ApiModelProperty("备注")
    private String remark;

    @ApiModelProperty("部门对象")
    @TableField(exist = false)
    private SysDept dept;

    @ApiModelProperty("角色列表")
    @TableField(exist = false)
    private List<SysRole> roles;

    @ApiModelProperty("角色组")
    @TableField(exist = false)
    private Long[] roleIds;

    @ApiModelProperty("岗位组")
    @TableField(exist = false)
    private Long[] postIds;

    @ApiModelProperty("开始时间")
    @TableField(exist = false)
    private String beginTime;

    @ApiModelProperty("结束时间")
    @TableField(exist = false)
    private String endTime;

    public SysUser() {

    }

    public SysUser(Long userId) {
        this.userId = userId;
    }
}
